package cn.yr.controller.portal;

import cn.yr.common.util.Ret;
import cn.yr.domain.entity.Tag;
import cn.yr.service.portal.TagService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Tag)表控制层
 *
 * @author makejava
 * @since 2020-03-11 19:56:43
 */
@RestController
@RequestMapping("tag")
public class TagController {
    @Resource
    private TagService tagService;

    @RequestMapping("getTagList")
    public Ret<List<Tag>> getTagList(){
        QueryWrapper tagWrapper = new QueryWrapper<Tag>();
        tagWrapper.orderByAsc("createtime");
        List<Tag> list = tagService.list(tagWrapper);
        return Ret.success(list);
    }

}